import ajax from '@/api/ajax'

const { url } = require("../../build/config");

// console.log(config)

//  url.base_url;
const base_url = `${url.base_url}/api/auth-org`


export function orgsPage(data) {
  return ajax({
    url: `${base_url}/page`,
    method:'post',
    data:data
  })
}

export function orgsAdd(data) {
  return ajax({
    url: `${base_url}`,
    method:'post',
    data:data,
    showMsg: true,
  })
}

export function orgsUpdate(data) {
  return ajax({
    url: `${base_url}`,
    method:'put',
    data:data,
    showMsg: true,
  })
}


export function orgsDelete(key) {
  return ajax({
    url: `${base_url}/${key}`,
    method: 'delete',
    showMsg: true,
  })
}

export function orgsTree(key) {
  return ajax({
    url: `${base_url}/tree`,
    method:'get',
  })
}

export function orgsInfo(id) {
  return ajax({
    url: `${base_url}/${id}`,
    method: 'get'
  })
}
